import formBuilder from "@/comps/form/formBuilder";
import apiSeller from "@/pages/v1/erp/Seller/js/apiSeller";
/*
fb.addText("seller","供应商",3)
fb.addText("name","单位名称",3)
fb.addText("bank","银行",3)
fb.addText("bankName","开户行",3)
fb.addText("card","卡号",3)

* */
export default {
    main:function () {
        let fb = formBuilder()
        fb.setLabelWidth(100)

        fb.addSearch("sellerId","供应商",3)
            .setApi(apiSeller.urlChoice).setApiSearchKeys(["name__regex"])
        fb.addText("name","单位名称",3)
        fb.addText("bank","银行",3)
        fb.addText("bankName","开户行",3)
        fb.addText("card","卡号",3)

        return fb
    },
    tree:function () {
        let fb = formBuilder()
        fb.setLabelWidth(100)

        fb.addCascade("parentId").setLabel("上级分类").setSpan(3)
            .setApi(api.urlTree)

        fb.addText("name").setSpan(6).setLabel("分类名称")
            .setRules([fb.R.notNull("名称不能为空")])

        fb.addText("sort").setSpan(3).setLabel("排序").setTypeNumber()
        return fb
    },
    other:function () {
        let fb = formBuilder()
        fb.setLabelWidth(100).setLabelPosition("right")

        return fb
    }
}